#pragma once

#include <QProcess>
#include <QVariant>

class Process : public QProcess {
    Q_OBJECT

public:
    Process(QObject *parent = nullptr) {
        connect(&process, SIGNAL(finished(int)), this, SIGNAL(processFinished(int)));
    }

    Q_INVOKABLE void start(const QString &program, const QVariantList &arguments = {});
    Q_INVOKABLE void waitforprog();
    Q_INVOKABLE QByteArray readAll();
signals:
    void processFinished(int exitCode);
private:
    QProcess process;
};
